package com.jt;
import java.util.concurrent.TimeUnit;
enum Gender{  //Gender.class
    //定义三个枚举实例(类加载时创建)
    MALE,FEMALE,NONE("没有性别要求");
    private String name;
    private Gender(){}
    private Gender(String name){
        this.name=name;
    }
    public String getName(){
        return this.name;
    }
}
class Product{
    //性别要求
    Gender gender=Gender.NONE;
}
class EnumTests {
    public static void main(String[] args) throws InterruptedException {
        String name = Gender.NONE.getName();
        System.out.println("name="+name);
        TimeUnit.SECONDS.sleep(3);
    }
}